package com.example.anew.journey.mynewjourney.firstchangelogic.firstChangeHistoricalRecordDateList.adpter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.anew.journey.mynewjourney.R;
import com.example.anew.journey.mynewjourney.inteface.OnRecyclerViewItemClickListener;

/**
 * 杭州惟君医疗科技有限公司14
 * Created by 20433 on 2018/3/21
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class ChildItemAdapter  extends  RecyclerView.Adapter<ChildItemAdapter.ViewHolder> implements View.OnClickListener {
    private OnRecyclerViewItemClickListener mOnItemClickListener = null;
    public void setOnItemClickListener(OnRecyclerViewItemClickListener listener) {
        this.mOnItemClickListener = listener;
    }
    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view  =  View.inflate(parent.getContext(), R.layout.item_child_date_list,null);
        // 实例化viewholder
        ViewHolder viewHolder = new ViewHolder(view);
        view.setOnClickListener(this);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 3;
    }

    @Override
    public void onClick(View view) {
        if(mOnItemClickListener != null){
            mOnItemClickListener.onItemClick(view);
        }
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        private final TextView tv_test_heart_rate;
        private final TextView tv_test_date;
        private final ImageView iv_next_step;
        private final TextView tv_test_date_state;
        public ViewHolder(View itemView) {
            super(itemView);
            tv_test_heart_rate = itemView.findViewById(R.id.item_child_date_list_tv_test_heart_rate);
            tv_test_date = itemView.findViewById(R.id.item_child_date_list_tv_test_date);
            iv_next_step = itemView.findViewById(R.id.item_child_date_list_iv_next_step);
            tv_test_date_state = itemView.findViewById(R.id.item_child_date_list_tv_test_date_state);
        }
    }

}
